package com.googlecode.bip.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import javax.naming.NamingException;
import com.googlecode.bip.dao.utils.Listable;
import com.googlecode.bip.entity.IReferent;
import com.googlecode.bip.entity.IReferentReferentView;
import com.googlecode.bip.entity.ReferentReferentView;

/**
 * TODO: Doc!
 *
 * @author Claude CHOISNET
 */
public abstract class ReferentReferentViewDAO
        implements Listable<IReferentReferentView>
{
    private static final long serialVersionUID = 1L;

    @Override //Listable<IReferentReferentView>
    public IReferentReferentView newInstance(final ResultSet rSet )
        throws SQLException
    {
        return new ReferentReferentView().set( rSet );
    }

    /**
     * TODO: Doc!
     *
     * @param idreferent
     * @return
     * @throws NamingException
     * @throws SQLException
     */
    public abstract IReferentReferentView findReferent(
        int  idreferent
        ) throws NamingException, SQLException;

    /**
     * TODO: Doc!
     *
     * @return
     * @throws NamingException
     * @throws SQLException
     */
    public abstract List<IReferentReferentView> findReferentList()
        throws NamingException, SQLException;

    /**
     * TODO: Doc!
     *
     * @param referent
     * @return
     * @throws NamingException
     * @throws SQLException
     */
    public abstract boolean insertReferent( IReferentReferentView referent )
        throws NamingException, SQLException;

    /**
     * TODO: Doc!
     *
     * @param idreferent
     * @return
     * @throws NamingException
     * @throws SQLException
     */
    public abstract boolean deleteReferent(
        int  idreferent
        ) throws NamingException, SQLException;

    /**
     * TODO: Doc!
     *
     * @param referent
     * @return
     * @throws NamingException
     * @throws SQLException
     */
    public boolean deleteReferent(
    	IReferentReferentView referent
        ) throws NamingException, SQLException
    {
       return deleteReferent(
           referent.getIdReferent()
           );
    }

    /**
     * TODO: Doc!
     *
     * @param referent
     * @return
     * @throws NamingException
     * @throws SQLException
     */
    public abstract boolean updateReferent( IReferent referent )
        throws NamingException, SQLException;
}

